package com.smdk.dsminio.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smdk.dsminio.dao.DsminioBucketInfoMapper;
import com.smdk.dsminio.entity.DsminioBucketInfo;
import com.smdk.dsminio.service.DsminioBucketInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * bucket信息表(DsminioBucketInfo)表服务实现类
 *
 * @author 神秘的凯
 * @since 2020-10-28 14:58:52
 */
@Service
public class DsminioBucketInfoServiceImpl extends ServiceImpl<DsminioBucketInfoMapper, DsminioBucketInfo> implements DsminioBucketInfoService {


    @Override
    public boolean createBucketInfo(DsminioBucketInfo bucketinfo) {
        return this.save(bucketinfo);
    }

    @Override
    public boolean deleteBucketInfo(List<Long> bucketId) {
        return this.removeByIds(bucketId);
    }

    @Override
    public boolean deleteBucketInfo(Long bucketId) {
        return this.removeById(bucketId);
    }

    @Override
    public boolean updateBucketInfo(DsminioBucketInfo bucketInfo) {
        return this.updateById(bucketInfo);
    }

    @Override
    public List<DsminioBucketInfo> searchBucketInfo(Long userId) {
        return this.query().eq("userId", userId).list();

    }

    @Override
    public DsminioBucketInfo searchBucketInfoById(Long bucketId) {
        return this.getById(bucketId);
    }
}